﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;


namespace PJ.Data.Inventory
{
    [Serializable]
    [DataContract]
    public class BaseInventoryBarCodeData : BaseEntityFragmentData, IInventoryBarCodeData
    {
        private double m_Quantity;

        public BaseInventoryBarCodeData()
        {
        }

        public BaseInventoryBarCodeData(BaseInventoryBarCodeData data)
            : base(data)
        {
        }

        [DataMember]
        public double Quantity
        {
            get { return m_Quantity; }
            set { m_Quantity = value; }
        }
        public override IObjectData Copy(IObjectData data)
        {
            base.Copy(data);
            this.Quantity = ((IInventoryBarCodeData)data).Quantity;
            return this;
        }
        public override bool IsEqual(IObjectData data)
        {
            if (base.IsEqual(data))
                if (((IInventoryBarCodeData)data).Quantity == this.Quantity)
                    return true;
            return false;
        }


        public override IObjectData CreateNewInstance()
        {
            return new BaseInventoryBarCodeData();
        }
    }
}
